package com.eddie.juc.locks;

class Book {

}

/**
 * @author Eddie
 * @date 2022/08/18 15:38
 **/
public class LockSyncDemo {

    Object o = new Object();
    final Book b1 = new Book();

    public void m1() {
        synchronized (b1) {
            System.out.println("----Hello synchronized code block");
            throw new RuntimeException("----exp");
        }
    }

    public synchronized void m2() {
        System.out.println("----Hello synchronized m2");
    }

    public static synchronized void m3() {
        System.out.println("----Hello synchronized m3");
    }

    public static void main(String[] args) {

    }
}
